

<script src="<?php echo base_url() . 'public/'; ?>assets/js/theme.js"></script>
<script src="<?php echo base_url() . 'public/'; ?>assets/js/amazeui.min.js"></script>
<script src="<?php echo base_url() . 'public/'; ?>assets/js/app.js"></script>

<style>
    .bottomline{  border-bottom: 1px solid rgb(127, 127, 255); }
    body{text-align:center;background-image:url(<?php echo base_url();?>/public/assets/image/background.jpg); ; width: 90% ;height:600px; margin-left: 5% }
    .loginbox{background-color: white; margin:0 auto;  margin-top: 200px; width: 870px; height: 520px; border-radius:30px; }
    .loginbox_1{ width: 50%;height: 100%; float: left; }
    .loginbox_left{background-image:url(<?php echo base_url();?>/public/assets/image/loginleft.png);width: 47% }
    .loginbox_right{ width: 45%}
    .loginbox_right_1{ width: 100%;}
    .loginbox_right_top{ text-align: center;font-size: 28px; margin-top: 60px; font-weight:bold}
    .loginbox_right_mid{ height: 250px; margin-top: 0px;}
    .input{ width: 100%; height: 60px; margin:0 auto;}
    .input_1 {height: 70%}
    .bottomline1{ height: 100% ;width: 250px;}
    .input_left{ width:20%; float: left; margin-top: 20px }
    .input_left img{ }
    .input_right{ width:80%; float: left; margin-top: 20px }
    .logininput { float: left; width: 200px;  height: 30px;  }
    input {
        outline:none;
        background:transparent;
        border:none;
        outline:medium;
    }
    *:focus {
        outline: none;
        background-color: transparent;
    }
 /*   ::selection{background:transparent; }
    ::-moz-selection{background:transparent; }*/


    .loginbox_right_bottom{ text-align:center; margin-top: 5px;}
    .button{  text-align: center; width:225px; background-color: #0c7edf; margin: auto; height: 40px;  font-size: 20px; color: white; margin-top: 25px; border-radius:30px;}
    .juzhongwenzi{ margin: auto; padding-top: 4px ;cursor:pointer }

    .getcode{ text-align: center;background-color: #0c7edf; margin: auto; line-height:35px; height: 35px;  font-size: 13px; color: white;border-radius:6px; width:100px; margin-left: 104px;}
    .phonecode{ width: 100px;}
    .disabled{ background-color: #9ca5af}
    .reg{ text-align: center; font-size: 14px; width: 100%; height: 30px; margin-left: 40px; font-weight:bold}
</style>
<body style="">
<div class="loginbox" >
    <div class="loginbox_1  loginbox_left"></div>
    <div class="loginbox_1  loginbox_right">
        <div class="loginbox_right_1  loginbox_right_top">注册账户</div>
        <div class="loginbox_right_1 loginbox_right_mid">
            <div class="input">
                <div class="bottomline1 bottomline" >
                    <div class="input_1 input_left"><img  src="<?php echo base_url();?>/public/assets/image/user.png"></div>
                    <div class="input_1 input_right"> <input class="logininput username"  placeholder="请输入用户名"></div>
                </div>

            </div>

            <div class="input" style="display: none">
                <div class="bottomline1 bottomline" >
                    <div class="input_1 input_left"><img  src="<?php echo base_url();?>/public/assets/image/shouji.png"></div>
                    <div class="input_1 input_right"> <input  type="text" class="logininput phone"  maxlength="11"  placeholder="请输入手机号"></div>
                </div>

            </div>

            <div class="input">
                <div class="bottomline1 bottomline" >
                    <div class="input_1 input_left"><img  src="<?php echo base_url();?>/public/assets/image/password.png"></div>
                    <div class="input_1 input_right"> <input   type="password" class="logininput password1"   placeholder="请输入密码" ></div>
                </div>
            </div>

            <div class="input">
                <div class="bottomline1 bottomline" >
                    <div class="input_1 input_left"><img  src="<?php echo base_url();?>/public/assets/image/password.png"></div>
                    <div class="input_1 input_right"> <input   type="password" class="logininput password2"   placeholder="再次请输入密码" ></div>
                </div>
            </div>

            <div class="input">
                <div class="bottomline1 bottomline" >
                    <div class="input_1 input_left"><img  src="<?php echo base_url();?>/public/assets/image/code.png"></div>
                    <div class="input_1 input_right"> <input   type="text" class="logininput Invitation"   placeholder="输入邀请码" ></div>
                </div>
            </div>



           <div class="input" style="display: none">
                <div class="bottomline1 bottomline" >
                    <div class="input_1 input_left"><img  style="width: 17px; height: 20px;" src="<?php /*echo base_url();*/?>/public/assets/image/code.png"></div>
                    <div class="input_1 input_right">
                        <input   type="text" class="logininput phonecode"   maxlength="6"  placeholder="手机验证码" >
                        <div class=" getcode">获取验证码</div>
                    </div>

                </div>
            </div>

        </div>

        <div class="loginbox_right_1 loginbox_right_bottom" >

            <div class="button tpl-login-btn" >   <div class="juzhongwenzi">注册</div>  </div>
            <div class="reg" > 我已有账户<a href="<?php echo base_url() . '/Welcome/register'; ?>" style="color: #0a9ffe">去登录</a></div>
        </div>
    </div>
</div>

<div class="nexsd_wx" style=" position: absolute;left: 85%;top:14%">
    <span style="font-size: 20px;color: white"> 客服二维码</span>
    <img  style="width: 300px" src="<?php echo $this->session->webinfo['weixin']; ?>">
</div>
</body>

<script>
    var send=0;
    var looptimes=60;
    var Invitation="<?php echo $Invitation; ?>";

    if(Invitation!=''){
        console.log(Invitation)
        $(".Invitation").val(Invitation);
    }else{
        $(".nexsd_wx span").text('客服二维码(获取邀请码进行注册)')
    }
    $(".Invitation").change(function () {
        let val=$(this).val();
        if(val==""){
            $(".nexsd_wx span").text('客服二维码(获取邀请码进行注册)')
        }else{
            Invitation=val;
        }
    });

    $('.tpl-login-btn').click(
        function() {
            var data = {};
            data.username = $('.username').val();
            data.password1 = $('.password1').val();
            data.password2 = $('.password2').val();
            data.Invitation =Invitation;
           // data.phone = $('.phone').val();
           // data.code = $('.phonecode').val();

            if( data.username==""){
                layer.msg("用户名不能为空", {icon: 7});
                return;
            }
            if( data.password1==""){
                layer.msg("密码不能为空", {icon: 4});
                return;
            }
            if( data.password2==""){
                layer.msg("密码不能为空", {icon: 4});
                return;
            }
            if( data.password1!=data.password2){
                layer.msg("二次密码不一致", {icon: 4});
                return;
            }
          /*  if(data.phone.length<11){
                layer.msg("手机格式不正确", {icon: 4});
                return;
            }
            if(data.code.length!=6){
                layer.msg("验证码不正确", {icon: 4});
                return;
            }*/
            /*   data.group = $(".group").val();*/
            var url = "<?php echo site_url(); ?>/Welcome/signaction";
            $.post(url,data,function(data) {
                if(data.code==0){
                    layer.msg('注册成功',{icon: 1,time:800},function () {
                        location.href = "<?php echo site_url(); ?>/Welcome/index";
                    });
                }else{
                    layer.msg(data.msg, {icon: 5});
                }
            },'json');
        }
    );
    $(".getcode").click(function () {
        if(send==1){
            return;
        }
        var data = {};
        data.phone = $('.phone').val();

        if(data.phone.length<11){
            layer.msg("手机格式不正确", {icon: 5,time:800});
            return;
        }
        var url = "<?php echo site_url(); ?>/Welcome/sendcode";
        $.post(url,data,function(data){
            if(data.code==0){
                layer.msg("发送成功", {icon: 1,time:800});
                $(".getcode").addClass("disabled");
                send=1;
                loop();
            }else{
                layer.msg(data.msg, {icon: 5,time:800});
            }
        },'json');
    });
    function loop() {
        if(looptimes==0){
            looptimes=60;
            $(".getcode").text("获取验证码");
            $(".getcode").removeClass("disabled");
            send=0;
            return;
        }
        $(".getcode").text(looptimes+"秒后可发送");
        looptimes=looptimes-1;
        setTimeout("loop()", 1000);
    }



</script>
</html>
